<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit - Firmware API: Web Server</title>
<link href="mt_doxygen.css" rel="stylesheet" type="text/css" />
<link href="../resources/mt_doxytabs.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.header {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
	color: #222222;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
    <tr>
      <td colspan="3">
        <form method="get" action="http://www.google.com/search">
          <div align="right">
            <input type="text"   name="q" size="25"
              maxlength="255" value="" />
            <input type="submit" value="Search" />
            <input type="hidden" name="sitesearch" value="makingthings.com/ref/firmware/html" />
          </div>
        </form>
       </td>
    </tr>
    <tr>
      <td><div align="center"><a href="http://www.makingthings.com">
				<img src="../resources/logo_brown_medium.png" alt="MakingThings"
									width="200" height="78" border="0" align="middle" longdesc="http://www.makingthings.com" /></a></div></td>
				<td><div align="center" class="header">
      		Make Controller Kit <br />
          Firmware API
      </div></td>
      <td><div align="center"><a href="http://www.makezine.com">
					<img src="../resources/make_logo.png" alt="MAKE Zine" 
										width="164" height="73" border="0" align="middle" longdesc="http://www.makezine.com" /></a></div></td>
    </tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.5.4 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>Web Server<br>
<small>
[<a class="el" href="group___controller.html">Controller</a>]</small>
</h1>Very simple Web Server.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#g5a95d049647db95b76a70bc5f722719c">WebServer_SetActive</a> (int active)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the active state of the WebServer subsystem.  <a href="#g5a95d049647db95b76a70bc5f722719c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#g3c8767183fe744b19e9fb799fe1b0e27">WebServer_GetActive</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read the active state of the WebServer subsystem.  <a href="#g3c8767183fe744b19e9fb799fe1b0e27"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#g617645f84a704ca27ed9650270ee2d26">WebServer_Route</a> (char *address, int(*handler)(char *requestType, char *address, char *requestBuffer, int requestMaxSize, void *socket, char *buffer, int len))</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds a route handler to the WebServer.  <a href="#g617645f84a704ca27ed9650270ee2d26"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#ge56f4878fa8d9edea8144a125e331878">WebServer_WriteResponseOkHTML</a> (void *socket)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes the HTTP OK message and sets the content type to HTML.  <a href="#ge56f4878fa8d9edea8144a125e331878"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#gf2e44af2fb70c641c47fc8954fd09067">WebServer_WriteResponseOkPlain</a> (void *socket)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes the HTTP OK message and sets the content type to HTML.  <a href="#gf2e44af2fb70c641c47fc8954fd09067"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#g161fe09ada669a6f0a27f3e0dd6a0b0d">WebServer_WriteHeader</a> (int includeCSS, void *socket, char *buffer, int len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes the HTML header.  <a href="#g161fe09ada669a6f0a27f3e0dd6a0b0d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#g33a47f02bdd0f2d8fd662648c4c0cad4">WebServer_WriteBodyStart</a> (char *reloadAddress, void *socket, char *buffer, int len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes the start of the BODY tag.  <a href="#g33a47f02bdd0f2d8fd662648c4c0cad4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__webserver.html#ge44633b0de4b28f0883744654f965e6d">WebServer_WriteBodyEnd</a> (void *socket)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes the end of the Body tag - and the final end of HTML tag.  <a href="#ge44633b0de4b28f0883744654f965e6d"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Very simple Web Server. 
<p>
This Web Server implementation is based on the ServerSocket and Socket functions defined in <a class="el" href="group___sockets.html">Sockets</a>. When started (usually by the Network subsystem), a ServerSocket is opened and set to listen on port 80.<p>
When the server receives a request, it checks the incoming address against a list of handlers. If the address matches, the handler is invoked and checking stops. Users can add their own handlers to return custom information. Handlers persist even when the server is deactivated.<p>
There are two default handlers. One is mounted at "/test" and will reply with the message "Test" and a current hit count. This handler will only be mounted if no other handlers are present when the server is started up. The other handler is a default handler which will match any address not already matched. This is the standard information page showing free memory, running tasks, etc. This page will reload every second from "/info". <hr><h2>Function Documentation</h2>
<a class="anchor" name="g3c8767183fe744b19e9fb799fe1b0e27"></a><!-- doxytag: member="webserver.c::WebServer_GetActive" ref="g3c8767183fe744b19e9fb799fe1b0e27" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_GetActive           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read the active state of the WebServer subsystem. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>State - 1/non-zero (on) or 0 (off). </dd></dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00163">163</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g617645f84a704ca27ed9650270ee2d26"></a><!-- doxytag: member="webserver.c::WebServer_Route" ref="g617645f84a704ca27ed9650270ee2d26" args="(char *address, int(*handler)(char *requestType, char *address, char *requestBuffer, int requestMaxSize, void *socket, char *buffer, int len))" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_Route           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int(*)(char *requestType, char *address, char *requestBuffer, int requestMaxSize, void *socket, char *buffer, int len)&nbsp;</td>
          <td class="paramname"> <em>handler</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Adds a route handler to the WebServer. 
<p>
This function binds an address fragment (e.g. "/", "/adcs", etc.) to a handler that will be called when the address matches. Matching ignores characters in the incoming address that are beyond the end of the address specified to this function. The first function to match the address will receive all the traffic and no more handlers will be checked. Thus if a handler is set up to match "/images" it will match "/images" and "/images/logo.png" and so on. Also if there is a subseqent handler set to match "/images/diagram" it will never be called since the prior handler will match the entire "/images" space.<p>
The handler will be called with the request type specified (usually "GET" or "PUT"), the incoming address ( "/device/0", "/images/logo.png", etc.) A buffer (and max length) is passed in that can be used to receive the rest of the message if necessary. Then there will be the socket which will take the response and a helpful large buffer or specified length which can be used to build strings.<p>
At the time the handler is called, only the first line of the request has been read. It is used to determing the request type and the address. If you need to process the request further its contents may be read into a buffer (the request buffer passed in might be good once the request type address have been used since they're in there initially). It is suggested that you use the <a class="el" href="group___sockets.html#gabf4d267c62d67bd596a22daea799662" title="Read a line from a TCP socket terminated by CR LF (0x0D 0x0A).">SocketReadLine( )</a> function to read a line of the request at a time.<p>
The handler itself must first write the response using one of WebServer_WriteResponseOkHTML for sending HTML or WebServer_WriteResponseOkPlain for returning plain text. These send the appropriate HTTP header (for example "HTTP/1.0 200 OK\r\nContent-type:text/html\r\n\r\n"). All responses may be simply written to the Socket, but several helpers are provided to assist in the construction of simple web pages (for example WebServer_WriteHeader, WebServer_WriteBodyStart, etc.)<p>
Here is an example handler which is installed when the server is started if there are no handlers already present. <div class="fragment"><pre class="fragment"><span class="keywordtype">int</span> TestHandler( <span class="keywordtype">char</span>* requestType, <span class="keywordtype">char</span>* address, <span class="keywordtype">char</span>* requestBuffer, <span class="keywordtype">int</span> requestMaxSize, <span class="keywordtype">void</span>* socket, <span class="keywordtype">char</span>* buffer, <span class="keywordtype">int</span> len )
{
  (void)requestType;
  (void)address;
  <a class="code" href="group__webserver.html#ge56f4878fa8d9edea8144a125e331878" title="Writes the HTTP OK message and sets the content type to HTML.">WebServer_WriteResponseOkHTML</a>( socket );
  <a class="code" href="group__webserver.html#g161fe09ada669a6f0a27f3e0dd6a0b0d" title="Writes the HTML header.">WebServer_WriteHeader</a>( <span class="keyword">true</span>, socket, buffer, len );
  <a class="code" href="group__webserver.html#g33a47f02bdd0f2d8fd662648c4c0cad4" title="Writes the start of the BODY tag.">WebServer_WriteBodyStart</a>( address, socket, buffer, len );
  snprintf( buffer, len, <span class="stringliteral">"&lt;H1&gt;TEST&lt;/H1&gt;%d hits"</span>, WebServer-&gt;hits );
  <a class="code" href="group___sockets.html#g1031bc0757e65ea265deb5dc3ded3029" title="Write to a TCP socket.">SocketWrite</a>( socket, buffer, strlen( buffer ) );
  <a class="code" href="group__webserver.html#ge44633b0de4b28f0883744654f965e6d" title="Writes the end of the Body tag - and the final end of HTML tag.">WebServer_WriteBodyEnd</a>( socket );
  <span class="keywordflow">return</span> <span class="keyword">true</span>;
}
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>An string specify the addresses to match. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>handler</em>&nbsp;</td><td>pointer to a handler function that will be called when the address is matched. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (=0) on success or the appropriate error if not </dd></dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00217">217</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g5a95d049647db95b76a70bc5f722719c"></a><!-- doxytag: member="webserver.c::WebServer_SetActive" ref="g5a95d049647db95b76a70bc5f722719c" args="(int active)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_SetActive           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>active</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the active state of the WebServer subsystem. 
<p>
This is automatically set to true by the Network Subsystem as it activates if the /network/webserver property is set to true. If there are no specifed handlers at the time of initialization, the default test handler is installed. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>active</em>&nbsp;</td><td>An integer specifying the active state - 1 (on) or 0 (off). </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success or the appropriate error if not </dd></dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00114">114</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="ge44633b0de4b28f0883744654f965e6d"></a><!-- doxytag: member="webserver.c::WebServer_WriteBodyEnd" ref="ge44633b0de4b28f0883744654f965e6d" args="(void *socket)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_WriteBodyEnd           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>socket</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Writes the end of the Body tag - and the final end of HTML tag. 
<p>
Should be preceded writes to the socket with the content of the page. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>socket</em>&nbsp;</td><td>The socket to write to </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00335">335</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g33a47f02bdd0f2d8fd662648c4c0cad4"></a><!-- doxytag: member="webserver.c::WebServer_WriteBodyStart" ref="g33a47f02bdd0f2d8fd662648c4c0cad4" args="(char *reloadAddress, void *socket, char *buffer, int len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_WriteBodyStart           </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>reloadAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>len</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Writes the start of the BODY tag. 
<p>
Should be preceded by a call to WebServer_WriteHeader. Also writes a light grey background. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>reloadAddress</em>&nbsp;</td><td>string signalling the address of a 1s reload request. If it is NULL, no reload is requested. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>socket</em>&nbsp;</td><td>The socket to write to </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>Helper buffer which the function can use. Should be at least 300 bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>Helper buffer length </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000012">Todo:</a></b></dt><dd>more parameterization of the tag </dd></dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00310">310</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g161fe09ada669a6f0a27f3e0dd6a0b0d"></a><!-- doxytag: member="webserver.c::WebServer_WriteHeader" ref="g161fe09ada669a6f0a27f3e0dd6a0b0d" args="(int includeCSS, void *socket, char *buffer, int len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_WriteHeader           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>includeCSS</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>len</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Writes the HTML header. 
<p>
Should be preceded by a call to WebServer_WriteResponseOkHTML <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>includeCSS</em>&nbsp;</td><td>flag signalling the inclusion of a very simple CSS header refining header one and body text slightly. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>socket</em>&nbsp;</td><td>The socket to write to </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>Helper buffer which the function can use. Should be at least 300 bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>Helper buffer length </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000011">Todo:</a></b></dt><dd>more parameterization </dd></dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00283">283</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="ge56f4878fa8d9edea8144a125e331878"></a><!-- doxytag: member="webserver.c::WebServer_WriteResponseOkHTML" ref="ge56f4878fa8d9edea8144a125e331878" args="(void *socket)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_WriteResponseOkHTML           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>socket</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Writes the HTTP OK message and sets the content type to HTML. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>socket</em>&nbsp;</td><td>The socket to write to </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00245">245</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="gf2e44af2fb70c641c47fc8954fd09067"></a><!-- doxytag: member="webserver.c::WebServer_WriteResponseOkPlain" ref="gf2e44af2fb70c641c47fc8954fd09067" args="(void *socket)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int WebServer_WriteResponseOkPlain           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>socket</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Writes the HTTP OK message and sets the content type to HTML. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>socket</em>&nbsp;</td><td>The socket to write to </td></tr>
  </table>
</dl>

<p>Definition at line <a class="el" href="webserver_8c-source.html#l00269">269</a> of file <a class="el" href="webserver_8c-source.html">webserver.c</a>.</p>

</div>
</div><p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit</title>
<style type="text/css">
<!--
.footer {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #999999;
}
-->
</style>
</head>

<body>
<hr size="1">
<div>
  <p class="footer">The Make Controller Kit is an open source project maintained by <a href="http://www.makingthings.com">MakingThings</a>.<br />
    MakingThings code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 license</a>.<br />
    Bug tracker, development wiki and status can be found at <a href="http://dev.makingthings.com">http://dev.makingthings.com</a>.<br />
		This document was last updated on 5 Dec 2007.
</p>
</div>
<!-- Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-769030-1";
urchinTracker();
</script>
</body>
</html>
